package com.budwk.app.sqfw.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * 推送消息渠道枚举
 */

@Getter
public enum PushChannelEnum {

    HUAWEI("huawei", "华为"),
    VIVO("vivo", "vivo"),
    OPPO("oppo", "oppo"),
    XIAOMI("xiaomi", "小米");

    private String name;

    private String desc;

    PushChannelEnum(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public static Optional<PushChannelEnum> getPushChannelEnum(String name) {
        Optional<PushChannelEnum> optional = Arrays.stream(PushChannelEnum.values()).filter(p -> p.getName().equals(name)).findAny();
        return optional;
    }
}
